package test.bmdever
{
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.geom.Matrix;
	
	import level4.assets.AssetsManager;
	import level4.assets.cache.AssetsDb;
	import level4.assets.cache.PlayableBitmap;

	public class BmdTest extends Sprite
	{
		private var w:int = 320;
		private var h:int = 240;
		
		public function BmdTest()
		{
			init();
		}
		
		public function init():void{
			var that:BmdTest = this;
			
			AssetsManager.loadSwfs(["assets/XiCheDongHua.swf"],null,function():void{
				var pbs:Array = [];
				for(var i:int =0;i<1;i++){
					var m:Matrix = new Matrix(2.5,0,0,2.5);
					var pb:PlayableBitmap = AssetsDb.Store("XiCheDongHua",m);
						pb.gotoAndStop(5);
					addChild(pb);
					
					pb.x = w * Math.random();
					pb.y = h * Math.random();
					pbs.push(pb);
				}
				//-----------
				that.addEventListener(Event.ENTER_FRAME,function(e:Event):void{
					for(var i:int = 0;i<pbs.length;i++){
						pbs[i].frontToEndPlay();
					}
				});
			});
		}
	}
}